const mongoose = require('mongoose');
/* 
itemName 商品名称
itemPrice 商品价格
desc 商品描述
store 库存
sales 销量
createAt  创建时间
thumb 封面图片
content 详情
*/
const itemSchema = new mongoose.Schema({
  itemName: {
    type: String,
    required: true
  },
  itemPrice: {
    type: Number,
    required: true
  },
  desc: String,
  store: {
    type: Number,
    default: 0
  },
  sales:{
    type: Number,
    default: 0
  },
  createAt: {
    type: String,
    required: true
  },
  thumb: String,
  content: String
})
// 创建表
const itemModel = mongoose.model('qf_items', itemSchema);

module.exports = itemModel;